All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced - Volume 2: Mastering IOT at a Stretch from Raspberry Pi, through Linux, Apache, MySQL,and PHP, and to Interface and Sensor by DuegGyu Kim

All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced - Volume 2: Mastering IOT at a Stretch from Raspberry Pi, through Linux, Apache, MySQL,and PHP, and to Interface and Sensor by DuegGyu Kim

Author:DuegGyu Kim
Language: eng
Format: azw3, epub
Publisher: UNKNOWN
Published: 2017-06-01T07:00:00+00:00


● "for" statement

"for" statement performs a specified operations for a specified range.

The example below prints each word and its length stored in the "words" variable.

# Measure some strings:

words = ['cat', 'window', 'defenestrate']

for w in words:

print(w, len(w))

23.5.4 Running Python Program

23.5.4.1 Creating Python Program file in IDLE

If you want to create a Python program file in IDLE, use menu File àNew File. This will open a blank window, which is not an Python prompt, just an empty file. Here, you can write Python code, save it as a file, and run it. Then, the processing result appears in another window. Let's enter the following sentence into a new window, save it as a file by using menu File à Save or [Ctrl + S], and then run it by using menu Run à Run Module or [F5] key. You can see that the result is displayed in the original Python Shell window.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.